#ifndef V2_NIM_SETTING_SERVICE_H
#define V2_NIM_SETTING_SERVICE_H
#include "v2_nim_internal.hpp"
namespace v2 {
/// @brief 通知服务
/// @pre
/// 调用 `V2NIMClient::get()` 拿到 client 实例
/// 调用 `client.getSettingService()` 拿到 settingService 实例
/// @par 示例代码
/// @code
/// auto& client = V2NIMClient::get();
/// auto& settingService = client.getSettingService();
/// @endcode
class V2NIMSettingService {
public:
    /// @brief 获取会话消息免打扰状态
    /// @param conversationId 会话 ID
    /// @return bool 会话消息免打扰状态
    /// @par 示例代码
    /// @code
    /// auto mute = settingService.getConversationMuteStatus(conversationId);
    /// @endcode
    virtual bool getConversationMuteStatus(nstd::string conversationId) = 0;

    /// @brief 设置群消息免打扰模式
    /// @param teamId 群组 ID
    /// @param teamType 群组类型
    /// @param muteMode 免打扰模式
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// settingService.setTeamMessageMuteMode(
    ///     "teamId",
    ///     V2NIM_TEAM_TYPE_NORMAL,
    ///     V2NIM_TEAM_MESSAGE_MUTE_MODE_ON,
    ///     []() {
    ///         // set team mute mode succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // set team mute mode failed, handle error
    ///     });
    /// @endcode
    virtual void setTeamMessageMuteMode(nstd::string teamId,
        V2NIMTeamType teamType,
        V2NIMTeamMessageMuteMode muteMode,
        V2NIMSuccessCallback<void> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 获取群消息免打扰模式
    /// @param teamId 群组 ID
    /// @param teamType 群组类型
    /// @return V2NIMTeamMessageMuteMode 群消息免打扰模式
    /// @par 示例代码
    /// @code
    /// auto muteMode = settingService.getTeamMessageMuteMode("teamId", V2NIM_TEAM_TYPE_NORMAL);
    /// @endcode
    virtual V2NIMTeamMessageMuteMode getTeamMessageMuteMode(nstd::string teamId, V2NIMTeamType teamType) = 0;

    /// @brief 设置点对点消息免打扰模式
    /// @param accountId 账号
    /// @param muteMode 免打扰模式
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// settingService.setP2PMessageMuteMode(
    ///     "accountId",
    ///     V2NIM_P2P_MESSAGE_MUTE_MODE_ON,
    ///     []() {
    ///         // set p2p mute mode succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // set p2p mute mode failed, handle error
    ///     });
    /// @endcode
    virtual void setP2PMessageMuteMode(nstd::string accountId,
        V2NIMP2PMessageMuteMode muteMode,
        V2NIMSuccessCallback<void> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 获取点对点消息免打扰模式
    /// @param accountId 账号
    /// @return V2NIMP2PMessageMuteMode 点对点消息免打扰模式
    /// @par 示例代码
    /// @code
    /// auto muteMode = settingService.getP2PMessageMuteMode("accountId");
    /// @endcode
    virtual V2NIMP2PMessageMuteMode getP2PMessageMuteMode(nstd::string accountId) = 0;

    /// @brief 获取点对点消息免打扰列表
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// settingService.getP2PMessageMuteList(
    ///     [](nstd::vector<nstd::string> muteList) {
    ///         // get p2p mute list succeeded, handle mute list
    ///     },
    ///     [](V2NIMError error) {
    ///         // get p2p mute list failed, handle error
    ///     });
    /// @endcode
    virtual void getP2PMessageMuteList(V2NIMSuccessCallback<nstd::vector<nstd::string>> success, V2NIMFailureCallback failure) = 0;

    /// @brief 设置当桌面端在线时, 移动端是否需要推送
    /// @param need 是否需要推送
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// settingService.setPushMobileOnDesktopOnline(
    ///     true,
    ///     []() {
    ///         // set push mobile on desktop online succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // set push mobile on desktop online failed, handle error
    ///     });
    /// @endcode
    virtual void setPushMobileOnDesktopOnline(bool need, V2NIMSuccessCallback<void> success, V2NIMFailureCallback failure) = 0;

    /// @brief 设置免打扰与详情显示
    /// @return V2NIMDndConfig
    /// @par 示例代码
    /// @code
    /// V2NIMDndConfig config;
    /// settingService.setDndConfig(
    ///     config,
    ///     []() {
    ///         // set dnd config succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // set dnd config failed, handle error
    ///     });
    /// );
    /// @endcode
    virtual void setDndConfig(V2NIMDndConfig config, V2NIMSuccessCallback<void> success, V2NIMFailureCallback failure) = 0;

    /// @brief 读取免打扰与详情显示接口
    /// @return V2NIMDndConfig
    /// @par 示例代码
    /// @code
    /// V2NIMDndConfig dndConfig = settingService.getDndConfig();
    /// @endcode
    virtual V2NIMDndConfig getDndConfig() = 0;

    /// @brief 添加设置监听
    /// @param listener 监听器
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMTeamListener listener;
    /// listener.onTeamMessageMuteModeChanged = [](nstd::string teamId, V2NIMTeamType teamType, V2NIMTeamMessageMuteMode muteMode) {
    ///     // handle team message mute mode changed
    /// };
    /// listener.onP2PMessageMuteModeChanged = [](nstd::string accountId, V2NIMP2PMessageMuteMode muteMode) {
    ///     // handle p2p message mute mode changed
    /// };
    /// settingService.addSettingListener(listener);
    /// @endcode
    virtual void addSettingListener(V2NIMSettingListener listener) = 0;

    /// @brief 移除设置监听
    /// @param listener 监听器
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMTeamListener listener;
    /// // ......
    /// settingService.addSettingListener(listener);
    /// // ......
    /// settingService.removeSettingListener(listener);
    /// @endcode
    virtual void removeSettingListener(V2NIMSettingListener listener) = 0;
};
}  // namespace v2
#endif